<?php

namespace app\admin\model\test\dyzn;

use think\Model;

class Subject extends Model
{
    // 表名
    protected $name = 'test_dyzn_subject';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $answers = [
        'a' => '非常符合',
        'b' => '比较符合',
        'c' => '说不清',
        'd' => '比较不符合',
        'e' => '非常不符合'
    ];
    // 追加属性
    protected $append = [

    ];
    

    public function getCateIdAttr($v,$d){
        $cates = (new \app\admin\model\test\dyzn\Cate()) -> select();
        $cs = [];
        foreach ($cates as $k => $val){
            $cs[$val['id']] = $val['name'];
        }
        return $cs[$v];
    }


    public function getAAttr($v){
        return $this -> answers[strtolower($v)];
    }
    public function getBAttr($v){
        return $this -> answers[strtolower($v)];
    }
    public function getCAttr($v){
        return $this -> answers[strtolower($v)];
    }
    public function getDAttr($v){
        return $this -> answers[strtolower($v)];
    }
    public function getEAttr($v){
        return $this -> answers[strtolower($v)];
    }





}
